package com.ruoyi.notice.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ruoyi.notice.mapper.MgNoticeMapper;
import com.ruoyi.notice.domain.MgNotice;
import com.ruoyi.notice.service.IMgNoticeService;
import com.basic.service.impl.BaseServiceImpl;

/**
 * 消息通知Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class MgNoticeServiceImpl extends BaseServiceImpl<Long, MgNotice> implements IMgNoticeService 
{
	
	
	
	
    public MgNoticeServiceImpl(MgNoticeMapper baseMapper) {
		super(baseMapper);
		// TODO Auto-generated constructor stub
	}
    
    
    
    /**
     * 查询消息通知
     * 
     * @param id 消息通知主键
     * @return 消息通知
     */
    @Override
    public MgNotice selectById(Integer id)
    {
        return baseMapper.selectById(id);
    }

    /**
     * 查询消息通知列表
     * 
     * @param mgNotice 消息通知
     * @return 消息通知
     */
    @Override
    public List<MgNotice> selectList(MgNotice mgNotice)
    {
        return baseMapper.selectList(mgNotice);
    }

    /**
     * 新增消息通知
     * 
     * @param mgNotice 消息通知
     * @return 结果
     */
    @Override
    @Transactional(propagation = Propagation.MANDATORY)
    public int insert(MgNotice mgNotice)
    {
    	insertProperties(mgNotice);
    	
        baseMapper.insert(mgNotice);
        
        return mgNotice.getId();
    }

    /**
     * 修改消息通知
     * 
     * @param mgNotice 消息通知
     * @return 结果
     */
    @Override
    public int update(MgNotice mgNotice)
    {
    	updateProperties(mgNotice);
        return baseMapper.update(mgNotice);
    }

    /**
     * 批量删除消息通知
     * 
     * @param ids 需要删除的消息通知主键
     * @return 结果
     */
    @Override
    public int deleteByIds(Integer[] ids)
    {
        return baseMapper.deleteByIds(ids);
    }

    /**
     * 删除消息通知信息
     * 
     * @param id 消息通知主键
     * @return 结果
     */
    @Override
    public int deleteById(Integer id)
    {
        return baseMapper.deleteById(id);
    }


   
}
